//
// Created by EDZ on 2022/2/23.
//

#ifndef BASIC_GRAMMA_CONSTEXPR_H
#define BASIC_GRAMMA_CONSTEXPR_H

template<class Type, Type Val>
struct my_integral_constant {
    static constexpr Type value = Val;

    typedef Type value_type;
    typedef my_integral_constant<Type, Val> type;

    /// 类型转换
    constexpr explicit operator value_type() const noexcept {
        // return stored value
        return (value);
    }

    constexpr value_type operator()() const noexcept {
        return (value);
    }
};

typedef my_integral_constant<bool, true> my_true_type;
typedef my_integral_constant<bool, false> my_false_type;

template<class Type>
struct my_is_const : my_false_type {
    // determine whether _Ty is const qualified
};

template<class Type>
struct my_is_const<const Type> : my_true_type {
    // determine where _Ty is const qualified
};



void func_gramma_constexpr();

void func_gramma_constexpr_basic();

int func_compute_in_compile_time();

#endif //BASIC_GRAMMA_CONSTEXPR_H
